enum LifeCycle {
    Home(u32),
    Cycle(u32),
    Tail(u32),
}

enum UnitColor {
    Red,
    Yellow,
    Green,
    Blue,
}

struct MapUnit {
    x: f32,
    y: f32,
    color: UnitColor,
    isHome: bool,
    isFly: bool,
    isEnd: bool,
    isTurn: bool,
}

const big_interval: f32 = 125.0 / 1440.0;
const small_interval: f32 = 85.0 / 1440.0;

// 红色起点
static red_home_unit: &[MapUnit] = &[
    // 左上
    MapUnit {
        x: 116.0 / 1440.0,
        y: 145.0 / 1440.0,
        color: UnitColor::Red,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    // 右上
    MapUnit {
        x: 116.0 / 1440.0 + big_interval,
        y: 145.0 / 1440.0,
        color: UnitColor::Red,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    // 左下
    MapUnit {
        x: 116.0 / 1440.0,
        y: 145.0 / 1440.0 + big_interval,
        color: UnitColor::Red,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    // 右下
    MapUnit {
        x: 116.0 / 1440.0 + big_interval,
        y: 145.0 / 1440.0 + big_interval,
        color: UnitColor::Red,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 68.0 / 1440.0,
        y: 415.0 / 1440.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
];

// 黄色起点
static yellow_home_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
];

// 绿色起点
static green_home_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
];

// 蓝色起点
static blue_home_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: true,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
];

// 环形棋盘
static cycle_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: true,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: true,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: true,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: true,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: true,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: true,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: true,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: true,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
];

// 红色末尾
static red_tail_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Red,
        isHome: false,
        isFly: false,
        isEnd: true,
        isTurn: false,
    },
];

// 黄色末尾
static yellow_tail_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Yellow,
        isHome: false,
        isFly: false,
        isEnd: true,
        isTurn: false,
    },
];

// 绿色末尾
static green_tail_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Green,
        isHome: false,
        isFly: false,
        isEnd: true,
        isTurn: false,
    },
];

// 蓝色末尾
static blue_tail_unit: &[MapUnit] = &[
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: false,
        isTurn: false,
    },
    MapUnit {
        x: 0.0,
        y: 0.0,
        color: UnitColor::Blue,
        isHome: false,
        isFly: false,
        isEnd: true,
        isTurn: false,
    },
];
